<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            margin: 1rem;

            text-align: center;
        }

        .container {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 400px;
            flex-wrap: wrap;
        }

        .rectangle {
            margin: 1rem;
            width: 100px;
            height: 100px;
            border-radius: 8px;
            background-color: #1a2a91;
            animation: change 4.5s infinite linear;
            opacity: 0.1;
        }
     
        .rectangle:nth-child(2) {
            animation-delay: 0.5s;
        }

        .rectangle:nth-child(3) {
            animation-delay: 1s;
        }

        .rectangle:nth-child(4) {
            animation-delay: 1.5s;
        }

        .rectangle:nth-child(5) {
            animation-delay: 2s;
        }

        .rectangle:nth-child(6) {
            animation-delay: 2.5s;
        }

        .rectangle:nth-child(7) {
            animation-delay: 3s;
        }

        .rectangle:nth-child(8) {
            animation-delay: 3.5s;
        }

        .rectangle:nth-child(9) {
            animation-delay: 4s;
        }

        @keyframes change {
            0% {
                /* background-color: #1a2a91; */
                opacity: 1;
                transform: translateY(-2px) ;
            }

            50% {
                opacity: 0.5;
                transform: translateY(2px) ;
            }

            100% {
                /* background-color: #fff; */
                opacity: 1;
                transform: translateY(0px) ;

            }
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="rectangle"></div>
        <div class="rectangle"></div>
        <div class="rectangle"></div>


        <div class="rectangle"></div>
        <div class="rectangle"></div>
        <div class="rectangle"></div>

        <div class="rectangle"></div>
        <div class="rectangle"></div>
        <div class="rectangle"></div>
    </div>
</body>

</html>